<%@page import="by.epam.communalservices.utils.Login"%>
<%@page import="org.apache.jasper.tagplugins.jstl.core.ForEach"%>
<%@page import="java.util.Map"%>
<%@page import="java.util.List"%>
<%@page import="by.epam.communalservices.entity.User"%>
<%@page import="java.sql.Connection"%>
<%@page import="by.epam.communalservices.dao.jdbc.JdbcDaoUser"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib tagdir="/WEB-INF/tags/connect" prefix="connect"%>
<%@ taglib tagdir="/WEB-INF/tags/table" prefix="table"%>
<%@ taglib tagdir="/WEB-INF/tags/user" prefix="user"%>

<connect:isset/>
<connect:denny rules="admin,view,user_view" />

<user:list/>

<table:body style="width:75%;">
	<table:title span="5">
	   Список юзеров
	</table:title>
	<table:head names="id,login,password,roles,actions" />
	<c:set var="index" value="0" />
	<c:forEach items="${userList}" var="user">
		<c:set var="index" value="${index + 1}" />
		<user:line user="${user}" dif="${index mod 2 eq 0 ? 'c' : 'n'}" />
	</c:forEach>

	<table:title span="5" down="yes">
		<connect:display rules="admin,user_edit,edit">
			<button onclick="document.location.href='user_edit'"
				style='float: right;'>Add New User</button>
		</connect:display>
	</table:title>

</table:body>

